package com.bileetacrm;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class BileetaAddLeadAdditionalInfo extends Activity {
	String OptionKey;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.bileeta_add_lead_additional_info);

		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			OptionKey = extras.getString("TAGID");
		} else {
			OptionKey = "0";
		}

		/********** Android Drawer Menu Action ****************/
		Button buttonAddInquiry = (Button) findViewById(R.id.menu_add_inquiry);
		buttonAddInquiry.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent myIntent = new Intent(BileetaAddLeadAdditionalInfo.this,
						BileetaAddNewInquery.class);
				myIntent.putExtra("TAGID", OptionKey);
				startActivityForResult(myIntent, 0);

			}
		});

		Button buttonAddEvent = (Button) findViewById(R.id.menu_add_event);
		buttonAddEvent.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent myIntent = new Intent(BileetaAddLeadAdditionalInfo.this,
						BileetaAddNewEvent.class);
				myIntent.putExtra("TAGID", OptionKey);
				startActivityForResult(myIntent, 0);

			}
		});

		Button buttonAddtionalInfo = (Button) findViewById(R.id.menu_additional_info);
		buttonAddtionalInfo.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent myIntent = new Intent(BileetaAddLeadAdditionalInfo.this,
						BileetaAddLeadAdditionalInfo.class);
				myIntent.putExtra("TAGID", OptionKey);
				startActivityForResult(myIntent, 0);

			}
		});

		Button buttonAddContact = (Button) findViewById(R.id.menu_add_to_contacts);
		buttonAddContact.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent myIntent = new Intent(BileetaAddLeadAdditionalInfo.this,
						BileetaAddContactInformation.class);
				myIntent.putExtra("TAGID", OptionKey);
				startActivityForResult(myIntent, 0);

			}
		});

		Button displayDetailsView = (Button) findViewById(R.id.displayDetailsView);
		displayDetailsView.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {

				if (OptionKey.equals("24")) {
					Intent intent = new Intent(
							BileetaAddLeadAdditionalInfo.this,
							BileetaSalesInquirySummaryActivity.class);
					startActivity(intent);
				} else {
					Intent intent = new Intent(
							BileetaAddLeadAdditionalInfo.this,
							BileetaFragmentActivity.class);
					intent.putExtra("TAGID", "1");
					startActivity(intent);
				}
			}
		});
		/**********************************************************/

	}

	@Override
	public void onBackPressed() {
		if (OptionKey.equals("24")) {
			Intent intent = new Intent(BileetaAddLeadAdditionalInfo.this,
					BileetaSalesInquirySummaryActivity.class);
			startActivity(intent);
		} else {
			Intent intent = new Intent(BileetaAddLeadAdditionalInfo.this,
					BileetaFragmentActivity.class);
			intent.putExtra("TAGID", "1");
			startActivity(intent);
		}
		// code here to show dialog
		super.onBackPressed(); // optional depending on your needs
	}
}
